perm filename PROB4.PUB[LSP,JRA]2 blob
sn#088017 filedate 1974-02-20 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 .SS(Problems involving list-notation,,P12:)
C00004 ENDMK
C⊗;
.SS(Problems involving list-notation,,P12:)
.BEGIN CENTERIT;SELECT 1;
.GROUP
I Translate the following lists into Sexpr dotted-pair notation.
←%21.%3 (A B C) %22.%3 (A) %23.%3 ((A)) %24.%3 (A (B (C))).
.APART
.GROUP
%1
Now go the other way and translate the following sexprs into list notation.
←%25.%3 ((A .(B . NIL)).((C . NIL). NIL)) %26.%3 (NIL . NIL)
←%27.%3 ((CONS .((QUOTE .(A . NIL)). NIL))
.APART
.GROUP
%1
II Evaluate the following, writing the results in list notation where possible.
←%21.%3 car[(A B)] %22.%3 cdr[(A B)] %23.%3 cons[A;(B C)] %24.%3 cons[A;NIL]
←%25.%3 cons[eq[A;A];(A B C)]
.APART
.GROUP
%1
.FILL
III Construct an expression evaluating to the list, %3(A B)%*, using only the
primitive functions and predicates, and the atoms %3A%* and %3B%*.
.END